package com.dms.mapper;

import com.dms.pojo.Building;
import com.dms.pojo.Dormitory;
import com.dms.pojo.Student;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @className: DormitoryManageMapper
 * @package: com.dms.mapper
 * @description  宿舍管理模块Dao接口
 * @author: sk
 */
public interface DormitoryManageMapper {

    //判断该楼栋该宿舍号是否存在
    Dormitory checkRoomByBuildingNumber(Map<String, Object> map);

    //添加寝室
    int addDormitory(Map<String, Object> dormitoryMap);

    //获取全部宿舍列表
    List<Dormitory> getDormitoryList();

    //统计在一个宿舍里的学生数
    int getTheSameDormitoryStudentCount(int dormitoryId);

    // 模糊分页查询 获取楼栋寝室列表
    List<Dormitory> getDormitoryListLimit(Map<String, Object> DormitoryList);

    // 获取寝室所住学生列表信息
    List<Student> getDormitoryStudentList(Map<String, Object> map);

    //获取 楼栋寝室total
    int getDormitoryTotal(Map<String, Object> totalMap);

    //获取寝室信息
    Dormitory getDormitoryInfo(Map<String, Object> map);

    //修改寝室信息
    int editDormitory(Dormitory dormitory);

    //1、更新原寝室人员的dormitoryId为null
    int batchUpdateStudentDormitoryId(int dormitoryId);

    //2、并删除寝室信息
    int deleteDormitory(int dormitoryId);
}
